package com.itheima.filter;

import javax.servlet.*;
import java.io.IOException;

//指定拦截 /login 这一个请求
// @WebFilter("/login")
//指定拦截 /emps开头的所有请求
// @WebFilter("/emps/*")
// @WebFilter("/*")        //拦截所有
public class Demo2Filter implements Filter {

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        //放行前的逻辑
        System.out.println("Demo2Filter...放行前的逻辑");

        chain.doFilter(req, resp);

        //放行后的逻辑
        System.out.println("Demo2Filter...放行后的逻辑");
    }


}
